﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    namespace="SmartHRMS.Model"
        assembly="SmartHRMS.Model">

  <class name="SmartHRMS.Model.Account.Module,SmartHRMS.Model" table="Accounts_Modules" lazy="false">

    <id name="ModuleId" column="ModuleId" type="guid">
      <generator class="guid" />
    </id>

    <property name="Description">
      <column name="Description"
                    not-null="true" sql-type="nvarchar(250)" length="250" />
    </property>

    <!-- 
		    Note lazy load on the permissions, We only want the permissions
		    to be loaded from the database when we want them
		 -->
    <bag
		    name="Permission"
		    cascade="none"
		    lazy="false"  >
      <key column="ModuleId" />
      <one-to-many class="SmartHRMS.Model.Account.Permission,SmartHRMS.Model" />
    </bag>

  </class>

</hibernate-mapping>